package demo.controller.form;

import demo.enums.TypeEnum;
import demo.swagger.ApiModelEnumProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author meilin.huang
 * @date 2022-02-16 5:57 PM
 */
@Data
public class NewTestForm {

    @ApiModelProperty("主键")
    private Long id;

    @ApiModelEnumProperty(value = "Integer类型", enumClass = TypeEnum.class)
    private Integer type;

    /**
     * 枚举类型字段 前端需传枚举对象名，如TestEnum中的T1，T2等
     */
    @ApiModelEnumProperty(value = "Enum类型", enumClass = TypeEnum.class, values = {"T1", "T2"})
    private TypeEnum typeEnum;

    /**
     * 只显示值为1和3对应的枚举值描述
     */
    @ApiModelEnumProperty(value = "限制指定枚举值类型", enumClass = TypeEnum.class, values = {"1", "3"})
    private Integer type2;
}
